package com.lovejes.cuniao.scheduling.datatransfer.datagetter;

import com.lovejes.cuniao.scheduling.exception.DataTransferException;


public class DataGetterFactory {

	static class SingletonHolder {
        static DataGetterFactory instance = new DataGetterFactory();
    }

    public static DataGetterFactory getInstance() {
        return SingletonHolder.instance;
    }
    
    public DataGetter getDataAdapterImpl(String className) throws DataTransferException {
    	DataGetter oDataGetter = null;
        try {
            Class<?> c = Class.forName(className);
            oDataGetter = (DataGetter) c.newInstance();
        } catch (Exception e) {
            throw new DataTransferException(e);
        }
        return oDataGetter;
    }
    
}
